<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

	<meta http-equiv="X-UA-Compatible" content="IE=7" />

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	
	<title>Adminus &#9679; Page</title>
	
    <style type="text/css" media="all">
		@import url("<?php echo base_url(); ?>css/style.css");
		@import url("<?php echo base_url(); ?>css/jquery.wysiwyg.css");
		@import url("<?php echo base_url(); ?>css/facebox.css");
		@import url("<?php echo base_url(); ?>css/visualize.css");
		@import url("<?php echo base_url(); ?>css/date_input.css");
    </style>
	
	<!--[if lt IE 8]><style type="text/css" media="all">@import url("css/ie.css");</style><![endif]-->

	<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
    <script>
      var map;
      function initialize() {
        var mapOptions = {
          zoom: 15,
          center: new google.maps.LatLng(<?php echo $ordine->indirizzo_geocoded; ?>),
          mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        map = new google.maps.Map(document.getElementById('map_canvas'),
            mapOptions);
      }

      google.maps.event.addDomListener(window, 'load', initialize);
    </script>

    <script type="text/javascript">
    function presaInCarico()
    {
    	document.forms[0].action = "<?php echo base_url(); ?>index.php/orders/incarico";
    	document.forms[0].submit();
    }

    function completa()
    {
    	document.forms[0].action = "<?php echo base_url(); ?>index.php/orders/completa";
    	document.forms[0].submit();
    }

    </script>

</head>





<body>
	
	<div id="hld">
	
		<div class="wrapper">		<!-- wrapper begins -->
	
	
			
			<div id="header">
				<div class="hdrl"></div>
				<div class="hdrr"></div>
				
				<h1><a href="#">Figaro</a></h1>
				
				<ul id="nav">
					<li class="active"><?php echo anchor("dashboard","Dashboard"); ?></li>
					<li ><a href="#">Ordini</a>
						<ul>
							<li><a href="#">Da Evadere</a></li>
							<li><a href="#">In Lavorazione</a></li>
							<li><a href="#">Storico</a></li>
						</ul>
					</li>
					<li><a href="#">Utenti</a>
						<ul>
							<li><a href="#">Lista Utenti</a></li>
							<li><a href="#">Lista Amministratori</a></li>
						</ul>
					</li>
					<li><a href="#">Catalogo</a>
						<ul>
							<li><?php echo anchor('products/categories','Categorie'); ?></li>
							<li><a href="#">Prodotti</a></li>
						</ul>
					</li>
				</ul>
				
				<p class="user">Ciao, <?php echo $_SESSION['utente']->nome . " " . $_SESSION['utente']->cognome; ?> | <a href="index.html">Logout</a></p>
			</div>		<!-- #header ends -->
			
			
			<div class="block small left">
			
				<div class="block_head">
					<div class="bheadl"></div>
					<div class="bheadr"></div>
					
					<h2>Informazioni Ordine</h2>	
				</div>		<!-- .block_head ends -->
				
				
				
				<div class="block_content">
				
					<h2>Prodotti Ordinati</h2>
					<table cellpadding="0" cellspacing="0" width="100%" class="sortable">
						
						<thead>
							<tr>
								<th>Prodotto</th>
								<th>Quantita'</th>
								<th>Prezzo</th>
							</tr>
						</thead>
						
						<tbody>
							<?php
								
							foreach ($dettaglio as $row)
							{
								echo "<tr>";
								echo "<td>".$row->nome."</td>";
								echo "<td>".$row->quantita."</td>";
								echo "<td>".$row->prezzo."</td>";
								echo "</tr>";
							}
							
							?>
							<tr>
								<th colspan="2">TOTALE</th>
								<th><?php echo $ordine->totale; ?></th>
							</tr>
						</tbody>

					</table>
					
					
					<h2>Spedizione</h2>
					<ul>
						<li>Indirizzo : <b><?php echo $ordine->indirizzo ;?></b></li>
						<li>Citta' : <b><?php echo $ordine->citta ;?></b></li>
						<li>CAP : <b><?php echo $ordine->cap; ?></b></li>
						<li>Tel : <b><?php echo $ordine->telefono; ?></b></li>
						<li>email : <b><?php echo $ordine->email; ?></b></li>
					</ul>
					
					
					
				</div>		<!-- .block_content ends -->
				
				<div class="bendl"></div>
				<div class="bendr"></div>
				
			</div>		<!-- .block.small.left ends -->
			
		
			
			<div class="block small right">
			
				<div class="block_head">
					<div class="bheadl"></div>
					<div class="bheadr"></div>
					
					<h2>Mappa Spedizione</h2>
				</div>		<!-- .block_head ends -->
				
				
				
				<div class="block_content" id="map_canvas"  style="height:300px;">
					
				</div>		<!-- .block_content ends -->
				
				<div class="bendl"></div>
				<div class="bendr"></div>
				
			</div>		<!-- .block.small.right ends -->

			<div class="block">
			
				<div class="block_head">
					<div class="bheadl"></div>
					<div class="bheadr"></div>
					
					<h2>Azioni</h2>
				</div>		<!-- .block_head ends -->
				
				
				
				<div class="block_content">
					<form name="azioni" method="post">
						<h3>Completa Ordine</h3>
						<br/>
						<input type="hidden" value="<?php echo $ordine->id; ?>" name="idOrdine">
						<input type="button" onclick="document.print()" class="submit long" value="Stampa">
						<?php if ($ordine->idStatoOrdine == 0) {
							echo '<input type="button" onclick="presaInCarico()" class="submit long" value="Prendi in carico">'	;
						}
						else {
							echo '<input type="button" onclick="completa()" class="submit long" value="Chiudi Ordine">'	;	
						}
						?>
						
					</form>
					<br/>
					<?php echo form_open('orders/reject'); ?>
						<h3>Rifiuta Ordine</h3>
						<?php echo validation_errors(); ?>
						<input type="hidden" value="<?php echo $ordine->id; ?>" name="idOrdine">
						<textarea name="motivo" cols="30" rows="5"></textarea>
						<br/><br/>
						<input type="submit"  class="submit long" value="Rifiuta">
					<?php echo form_close(); ?>
				</div>		<!-- .block_content ends -->
				
				<div class="bendl"></div>
				<div class="bendr"></div>
				
			</div>		<!-- .block.small.right ends -->
		
			
			
		
			
			
			<div id="footer">
			
				<p class="left"><a href="#">YourWebsite.com</a></p>
				<p class="right">powered by <a href="http://themeforest.net/item/adminus-beautiful-admin-panel-interface/94668?ref=enstyled">Adminus</a> v1.4</p>
				
			</div>
		
		
		</div>						<!-- wrapper ends -->
		
	</div>		<!-- #hld ends -->
	
	
	<!--[if IE]><script type="text/javascript" src="js/excanvas.js"></script><![endif]-->	
	<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.js"></script>
	<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.img.preload.js"></script>
	<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.filestyle.mini.js"></script>
	<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.wysiwyg.js"></script>
	<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.date_input.pack.js"></script>
	<script type="text/javascript" src="<?php echo base_url(); ?>js/facebox.js"></script>
	<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.visualize.js"></script>
	<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.visualize.tooltip.js"></script>
	<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.select_skin.js"></script>
	<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.tablesorter.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url(); ?>js/ajaxupload.js"></script>
	<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.pngfix.js"></script>
	<script type="text/javascript" src="<?php echo base_url(); ?>js/custom.js"></script>

	
</body>
</html>